package com.foreknow.dao.impl;

import com.foreknow.dao.GuestbookDao;
import com.foreknow.model.Guestbook;

import java.sql.SQLException;

public class GuestbookDaoImpl extends BaseDao implements GuestbookDao {
    @Override
    public boolean add(Guestbook guestbook) throws SQLException {
        String sql = "insert into guestbook(name,phone,email,title,content,createdtime) values(?,?,?,?,?,?)";
        int isRight = jt.update(sql,guestbook.getName(),guestbook.getPhone(),guestbook.getEmail(),
                guestbook.getTitle(),guestbook.getContent(),guestbook.getCreatedtime());
        return isRight == 1;
    }
}
